//
//  CollectionDataManager.h
//  collection
//
//  Created by 靖 张 on 11/22/11.
//  Copyright (c) 2011 Tsinghua University. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Feed.h"
#import "UserInfo.h"

@interface CollectionDataManager : NSObject {

}

@property (nonatomic, strong) NSMutableArray*  feedList;
@property (nonatomic, strong, readonly)   NSArray*    hotTagList;
@property (nonatomic, strong, readonly) NSDictionary* privateLetterSet;
@property (nonatomic, strong)   NSArray*    mentionedMsgList;
@property (nonatomic, retain) NSMutableSet* cachedUsers;
@property (nonatomic, retain)   UserInfo*   currentLoginUser;
@property (nonatomic, retain)   NSMutableArray*   searchHistory;

+ (id)sharedInstance;

+ (void)destroyInstance;

/*
 连网更新数据
 */
- (BOOL)updateFromServer;

/*
 从本地存储中读取相关数据
 */
- (BOOL)loadFromLocalStorage;

/*
 将当前数据保存至本地
 */
- (BOOL)saveToLocalStorage;

/*
 获取某条feed的全部评论
 */
- (NSArray*)commentListOfFeed:(Feed*)feed;

- (UserInfo*)cacheUserByUserID:(long long)userID;

- (NSArray*)getMoreFeed:(NSDate*)lastFeedTime requestNum:(int)num;

- (BOOL)addFeed:(Feed*)feed;

- (NSArray*)feedListWithTag:(NSString*)tag;

@end
